package cn.shenlong.portal.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.shenlong.portal.domain.Advertisement;
import cn.shenlong.portal.mapper.AdvertisementMapper;
import cn.shenlong.portal.service.AdvertisementService;

@Service("advertisementService")
public class AdvertisementServiceImpl implements AdvertisementService {

	@Autowired
	private AdvertisementMapper advertisementMapper;
	
	@Override
	public List<Advertisement> findAllAdv() {
 
		
		Map<String,Object> para = new HashMap<String,Object>();
		return advertisementMapper.findPageListByCriteria(para, new  RowBounds());
 
	}

	@Override
	public void updateAdv(Advertisement advertisement) {
		advertisementMapper.updateEntity(advertisement);
	}

	@Override
	public Advertisement findById(Integer Id) {
		return advertisementMapper.findByPK(Id);
	 
	}

}
